package com.chaopei.myobj;

/**
 * @Author Corday 天涯
 * @Date 2022/3/4 10:35
 */
public class MyMain {
    public static void main(String[] args) {
//        创建对象,类的实例instance
        Pet pet = new Pet("阿猫", "很萌样子");
        System.out.println(pet);
        System.out.println(pet.info);
        //创建数组并排序
        int[] arr = {10, 12, 10, 15, 19, 5, 98, 11};
        pet.bubbleSort(arr);
        System.out.println(arr);
        pet.findArr(arr);
        //再建数组并排序
        int[] array = {5, 16, 10, 16, 8, 17, 38, 23};
        System.out.println("\n");
        pet.selectSort(array);
        pet.findArr(array);
        //调用递归求和
        System.out.println("\n" + pet.recuSum(10));
//        创建匿名内部类
        String info = new Employee() {
            @Override
            public String speak() {
                return "阳春三月，江南草，杂花生树，群莺乱飞";
            }
        }.speak();
        System.out.println(info);
        /////////////创建子类对象///////////////
        Employee employee = new Manager(10001, "李帅", "男", "管理", 600);
        String str = ((Manager) employee).getSkill();
        System.out.println(str);
        String s = employee.speak();
        System.out.println(s);
        Manager manager = new Manager();
        manager.setEid(10002);
        manager.setUsername("大芳");
        manager.setMoney(600);
        //抽象父类，实现代码复用，维护方便，动态化
//        创建User的对象
        User user = new User();
        String point = user.getMiddle(10.5, 20.8, 50.5, -38.9);
        System.out.println(point);
    }
}
